package iohomework;

import java.io.*;
import java.nio.charset.StandardCharsets;

public class OSWDemo02 {
    public static void main(String[] args) throws IOException {

        FileOutputStream fos=new FileOutputStream("note.dat");
        OutputStreamWriter osw=new OutputStreamWriter(fos, StandardCharsets.UTF_8);
        String line="或许爱情更像落叶，看似飞翔却在坠落";
        osw.write(line);
        System.out.println("写入成功");
        osw.close();
    }
}
